package com.css.fault.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.css.fault.entity.ActiveFault;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author Dbj
 * @date 2024年09月27日  11:09
 */
@Mapper
@DS("slave")
public interface ActiveFaultMapper extends BaseMapper<ActiveFault> {
    @Select("SELECT st_extent(geom) extentText,st_astext(geom) geomText,st_length(ST_ShortestLine(geom,st_geometryfromtext(#{centerGeom},4490))) length from data_activefault group by length,geomText order by length limit 1")
    ActiveFault getNearestFault(String centerGeom);
}
